import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class HttpService {

  constructor(public http: HttpClient) { }

  putData(url: string, data: object) {
    return this.http.put(url, data);
  }
  postData(url: string, data: object) {
    // const httpOptions: any = {
    //   headers: new HttpHeaders({
    //     'Content-Type': 'application/json',
    //     'Authorization': 'my-auth-token'
    //   })
    // };
    return this.http.post(url, data ); // httpOptions
  }
  getData(url: string) {
    return this.http.get(url);
  }
}
